package com.allen.config;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.camunda.spin.impl.json.jackson.format.JacksonJsonDataFormat;
import org.camunda.spin.spi.DataFormatConfigurator;

/**
 * @Author 王蒙
 * @Date 2023/5/29 10:47
 * @Version 1.0
 */
public class JacksonDataFormatConfigurator implements DataFormatConfigurator<JacksonJsonDataFormat> {


    @Override
    public void configure(JacksonJsonDataFormat dataFormat) {
        ObjectMapper objectMapper = dataFormat.getObjectMapper();
        objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    }

    @Override
    public Class<JacksonJsonDataFormat> getDataFormatClass() {
        return JacksonJsonDataFormat.class;
    }


}
